import { useState } from 'react'
import logo from './logo.svg'
import './App.css'
import Modal from './components/common/modal'

function App() {
  const [visible,setVisible]=useState(false)
  const onModalClose=()=>{
    console.log('modal closed');
    setVisible(false)
  }
  const onModalConfirm=()=>{
    console.log('modal confirm');
    setVisible(false)
  }
  return (
    <div className="App">
      <Modal 
        visible={visible}
        title='登录'
        onClose={onModalClose}
        onConfirm={onModalConfirm}
      >
        <div>
          <h3>这里是自定义内容区域</h3>
          <p>qwer</p>
        </div>
      </Modal>
      <button onClick={()=>setVisible(true)}>Click Here</button>
    </div>
  )
}

export default App
